# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=qt-creator
_pkgname=qt-creator-opensource-src
pkgver=4.12.4
pkgrel=0
pkgdesc="Lightweight and cross-platform IDE for Qt"
url="https://qt-project.org/wiki/Category:Tools::QtCreator"
arch="all !armhf" # armhf blocked by qt5-qtdeclarative
license="GPL-3.0-only WITH Qt-GPL-exception-1.0"
depends="
	qt5-qtbase-sqlite
	qt5-qtquickcontrols
	qt5-qtquickcontrols2
	qt5-qtbase-dev
	qt5-qttools-dev
	"
makedepends="
	cmake
	botan-dev
	qt5-qtdeclarative-dev
	qt5-qtscript-dev
	qt5-qtquickcontrols2-dev
	"
ldpath="/usr/lib/qtcreator:/usr/lib/qtcreator/plugins"
source="https://download.qt.io/official_releases/qtcreator/${pkgver%.*}/$pkgver/$_pkgname-$pkgver.tar.xz
	fix-execinfo.patch
	"

builddir="$srcdir"/$_pkgname-$pkgver
prepare() {
	default_prepare
	sed -i qtcreator.pri -e'/CONFIG += c++14/aCONFIG += use_system_botan'
}

build() {
	qmake-qt5
	make CXX="${CXX:-g++}"
}

package() {
	make install INSTALL_ROOT="$pkgdir"/usr
	# install -Dm 644 "$srcdir"/qtcreator.desktop \
	# 	"$pkgdir"/usr/share/applications/qtcreator.desktop
}

sha512sums="9ba019e9fadcb8009d404c605b9665ccbe5dee14ce841982aaa67fb5ae34ab61c27806c640008f056f4dc38669df1a6401fa821b1b2280e53e4604e1dd27a9b3  qt-creator-opensource-src-4.12.4.tar.xz
416bf589487aa0a86df01cb07088d1bf316bb7b765753b870634be8f697c17a47a93c2240258e8f1707fe8e0137b8cbc1a7b85250986ede3bffb87c6c5f75311  fix-execinfo.patch"
